<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php"); ?>




<?

//接收需要修改的数据的id
$new_detail_nid = addslashes($_REQUEST['nid']);
$detail    = select_one_line_all_items($table_Prefix."login_admin","nid='".$new_detail_nid."'");


//传递过来的页面信息。返回的时候，会根据这些信息返回原来的页面
$nowpageid      = addslashes($_REQUEST['nowpageid']);
$sortby         = addslashes($_REQUEST['sortby']);
$sys_part       = addslashes($_REQUEST['sys_part']);


$_REQUEST['ai_author']      = $_SESSION['username'];


//设置需要搜索的表格的前缀后缀
$table        = $table_Prefix . "login_admin";


//重置密码
if($_REQUEST['ai_admin_password'] == ''){
    unset($_REQUEST['ai_admin_password']);
}
else{
    $_REQUEST['ai_admin_password'] = md5($_REQUEST['ai_admin_password']);
}



//修改密码
$old_mima = md5($_REQUEST['old_password']);
$new_mima = $_REQUEST['new_admin_password'];
$re_mima  = $_REQUEST['re_password'];

if(($old_mima==$detail['admin_password'])&&($new_mima))
{
    $_REQUEST['ai_admin_password']  =  md5($_REQUEST['new_admin_password']);
}






if(isset($_REQUEST['ai_weixin_send'])){
	$_REQUEST['ai_weixin_send'] = implode(',',$_REQUEST['ai_weixin_send']);
}
else{
	$_REQUEST['ai_weixin_send'] = '';
}

if(isset($_REQUEST['jcbd']) && $_REQUEST['jcbd'] == 1){
	$_REQUEST['ai_open_id'] = ''; //把open_id清空
}

 $sql=update_date($table,$_REQUEST,"nid",$new_detail_nid);


$query = mysql_query($sql) or die (mysql_error().$sql);
mysql_close($con);

?>



<?

$nowpageid = $_GET["nowpageid"];

?>


<script type="text/javascript">

     alert("输入信息已保存，点击确认返回继续操作.");
     document.location.href = "detail-statistic.php?nowpageid=<? echo $nowpageid ?>&sortby=<? echo $sortby?>&nid=<? echo $new_detail_nid ?>&sys_part=<? echo $sys_part ?>"

</script>


</body>
